﻿using KAsFrame.Common.Dto;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KAsFrame.Common.Application
{
    public interface ICommonCurdAppService<TPrimaryKeyType, T, TCreateDto, TUpdateDto, TDto>
        where T : IEntity<TPrimaryKeyType>, new()
        where TCreateDto : IEntityDto<TPrimaryKeyType>, new()
        where TUpdateDto : IEntityDto<TPrimaryKeyType>, new()
        where TDto : IEntityDto<TPrimaryKeyType>, new()
    {
        public Task<long> CreateAsync(TCreateDto createDto);

        public Task<bool> UpdateAsync(TUpdateDto updateDto);

        public Task<bool> DeleteAsync(TPrimaryKeyType id);

        public Task<TDto> GetAsync(TPrimaryKeyType id);

        public Task<PageReturnDto<TDto>> GetPageListAsync(PageReqDto pageReqDto);
    }
}
